package com.example.esstudy.model;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.data.elasticsearch.annotations.Mapping;
import org.springframework.data.elasticsearch.annotations.Setting;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

/**
 * @author shuc001
 * @Date 2018/9/6 下午4:21
 */

@Data
@Mapping(mappingPath = "mapping.json")
@Setting(settingPath = "setting.json")
@Document(indexName = "book",type = "doc",replicas =0)
public class Book implements Serializable{

    private String id="1";
    private String name="java入门";
    private Float price;
    private String author="束畅";
    private String address="机械工业出版社";
    private String desc="java入门必备";
    private String publishTime;
    private List<String> tags;

    @Data
    public static class Tag{
        private String name;
        private Integer id;
    }
}
